The peer-to-peer (P2P) application is one of the most important applications, which provides file sharing, storage and communication services over the network. In general, there are three main types of P2P networks: unstructured P2P, hybrid P2P and structured P2P. Furthermore, the structured P2P network is most popular one due to its outstanding performance of data discovery.
In the typical structured P2P network system, each data object is mapped to and stored in a specific peer with a unique identity (ID). Structured P2P network could result in an O(log N) imbalance factor in some objects stored in a target peer, when implemented by using a lookup procedure method for finding target peer. Some hotspots (i.e., heavy loading peers) in the network may cause network congestion, low routing performance and insufficient search hit rate. For example, when stored keywords are popular, the target peer handles large amount of indexes. It may cause unbalanced loads between peers. Moreover, the search hit rate decreases dramatically when hotspots become offline.
One of the most popular structured P2P network, namely Kademlia (KAD) structured P2P network, has its own load balancing strategy. The conventional KAD structured P2P network limits the number of indexes in each peer to avoid overloading. A peer can handle a maximum of 60,000 indexes and hold a maximum of 50,000 indexes of an individual keyword. Therefore, when a peer receives a publishing request while reaching the limit of maximum indexes, it will reply a successful message, even if the publishing request is rejected.
Therefore, there is a need for an approach to provide a new scheme and load balancing method that can adapt to the loading conditions of a structured P2P network and operate within existing protocols.
Some Exemplary Embodiments
These and other needs are addressed by the invention, wherein an approach is provided for reassigning and sharing loads to peers with same identities (i.e., modulo identities), which is based on a threshold (i.e., a request forwarding threshold (RFT)) corresponding to the loading condition of a structured peer-to-peer (P2P) network.
Another approach is provided for improving hit rate of keyword search without complex calculations.
According to one aspect of an embodiment of the present invention, a decentralized structured P2P network comprises a plurality of peers arranged in a plurality of zones. Each peer has a unique identity (ID), a modulo identity (mod ID) and a threshold. The peers are configured to store indexes of a key and share the same key to the peers with same mod ID in other zones. The threshold indicates maximum number of indexes stored in each peer. The mod ID of the peer is derived from a modulo relationship of the unique ID and the number of peers in the zone.
According to another aspect of an embodiment of the present invention, a load balancing method is provided for publishing a key to a target peer in a structured P2P network. The structured P2P network has a plurality of peers having at least a mod ID and a threshold, and the load balancing method comprises actions of receiving a request message from a sender peer, assigning a reassigned peer as a new target peer when the target peer excesses the threshold, and recording number of times of assigning a new target peer to a counter.
The threshold indicates maximum number of indexes stored in each peer, and the reassigned peers are configured to have a same mod ID of the target peer in other zones.
According to yet another aspect of an embodiment of the present invention, a load balancing method for searching a key of a search peer in a structured P2P network. The structured P2P network has indexes of the key shared sequentially among peers in different zones, each peer sharing the same key having a same modulo identity and a counter value, and the loading balancing method comprises actions of hashing a keyword to get the key, wherein the keyword is obtained from a query of the search peer, finding a target peer based on the key, obtaining the counter value from the target peer, determining the shared peers in the zones according to the counter and the mod ID, sending a search message to the peers and receiving answers from the peers shared the same key.
Still other aspects, features, and advantages of the invention are readily apparent from the following detailed description, simply by illustrating a number of particular embodiments and implementations, including the best mode contemplated for carrying out the invention. The invention is also capable of other and different embodiments, and its several details can be modified in various obvious respects, all without departing from the spirit and scope of the invention. Accordingly, the drawings and description are to be regarded as illustrative, and not as restrictive.